<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>手写Promise-then函数调用成功或失败的回调函数</title>
    <script src="./index.js"></script>
</head>

<body>
    <!--
        1、任何的实例化对象的__proto__(隐式原型属性)的值和构造函数中的prototype(显式原型属性)的值相同的
        2、任何的函数中的prototype的值都指向Object类型的对象的地址值
        3、Object.assign方法是对象间的合并的方法
    -->
    <script>
        let p = new Promise((resolve, reject) => {
            // resolve(100);
            reject('aaa');
            // throw '异常';
        });
        console.log(p);

        p.then(value => {
            console.log(value);
        }, reason => {
            console.log(reason);
        })
        // console.log(Promise.prototype);
        // Promise.prototype.then = function () { }
    </script>
</body>

</html>